package cn.wolfcode.car.business.domain;

import cn.wolfcode.car.base.domain.User;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.util.Date;

@Getter
@Setter
public class Contract {

    //审核状态012
    public static final Integer AUDITSTATUS_ROGRESS = 0;  //审核中
    public static final Integer AUDITSTATE_PASS = 1;  //审核通过
    public static final Integer AUDITSTATE_REJECT = 2;  //审核不通过

    //盖章状态  0否  1 是
    public static final boolean AFFIXSEALSTATE_OFF = false;  //否
    public static final boolean AFFIXSEALSTATE_ON = true;     //是

    //文件状态 0作废  1生效
    public static final boolean NULLIFYSTATE_OFF = false;  //作废
    public static final boolean NULLIFYSTATE_ON = true;     //生效

    private Long id;              //合同id

    private Long customerId;              //客户id
    private Customer customer;

    private String contractName;                //合同名称

    private String contractCode;                //合同编码

    private BigDecimal amounts;                  //合同金额

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
    private Date startDate;                 //合同生效开始时间

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
    private Date endDate;               //合同生效结束时间

    private Boolean affixSealState=AFFIXSEALSTATE_OFF;               //是否盖章确认 0 否 1 是

    private Integer auditState=AUDITSTATUS_ROGRESS;                 //审核状态 0 未审核 1 审核通过 2 审核不通过

    private Boolean nullifyState=NULLIFYSTATE_ON;               //是否作废 0 作废 1 在用

    private Long inputUser;                 //录入人id
    private User user;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone = "GMT+8")
    private Date inputTime;                 //录入时间

    private String appendix;                // 附件

}